#include <iostream>
#include <memory>

using namespace std;

class Obj {
public:
  int a;
};

int main() {
  shared_ptr<int> a, b;
  b = a;
  if (b == nullptr) {
    std::cout << "ptr is not a valid pointer.\n";
  }
  a = make_shared<int>(2);
  b = a;
  if (b) {
    std::cout << "*ptr=" << *b << "\n";
  }
  int &c = *b;
  cout << c << endl;
  return 0;
}